#ifndef MAP_H_INCLUDED_75349064
#define MAP_H_INCLUDED_75349064
//-----------------------------------------------------------------------------
// Copyright (c) 2011 David Waby
// Initially created on 31/10/2011
//-----------------------------------------------------------------------------

#include "IJsonSerialisable.h"
class Tile;
 
//-----------------------------------------------------------------------------
class Map : public IJsonSerialisable
{
public:

									Map();
	virtual							~Map();

	void							Construct();

	void							EnterTile(Point2 const * i_point2);
	void							UseTile(Point2 const * i_point2);
	void							ExitTile(Point2 const * i_point2);

	inline Tile const *				GetTile(int const i_x, int const i_y) const;
	inline Tile *					GetTile(int const i_x, int const i_y);
	inline Tile const *				GetTile(Point2 const * i_point2) const;
	inline Tile *					GetTile(Point2 const * i_point2);

	inline Point2 const *			GetSize() const;
	inline Point2 const *			GetStartPosition() const;

	virtual void					Serialise(Json::Value * o_root) const;
	virtual void					Deserialise(Json::Value const * i_root);

private:

	int								m_version;
	Point2							m_size;
	Point2							m_startPosition;
	Tile ***						m_tiles;

									Map(const Map &rhs);
									Map& operator = (const Map &rhs);
};

#include "Map.inl"

//-----------------------------------------------------------------------------
#endif // MAP_H_INCLUDED_75349064
